package com.wteam.PoJo.DTO;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor

public class coupon implements Serializable {
    @ApiModelProperty(required = false)
    private Integer id;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT,select = false)
    @ApiModelProperty(required = false)
    private LocalDateTime CreateTime;

    @TableField(fill = FieldFill.INSERT,select = false)
    @ApiModelProperty(required = false)
    private String CreateBy;


    @TableField(select = false)//不参与查询
    @ApiModelProperty( required = false)
    @TableLogic(value = "2", delval = "1")
    private Boolean DeleteFlag;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE,select = false)
    @ApiModelProperty(required = false)
    private String UpdateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE,select = false)
    @ApiModelProperty(required = false)
    private LocalDateTime UpdateTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "结束时间", example = "2021-05-17 23:59:59", required = true)
    @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime endTime;

    @ApiModelProperty(value = "活动名字",required = true)
    private String promotionName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开始时间", example = "2021-05-17 23:59:59", required = true)
    @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime startTime;

    @ApiModelProperty(value = "优惠卷名字",required = true)
    private String couponName;

    @ApiModelProperty(value ="活动类型",required = true )
    private  String couponType;

    @ApiModelProperty(value ="活动描述",required = true )
    private String description;

    @ApiModelProperty(value = "优惠卷类型",required = true)
    private String getType;

    @ApiModelProperty(value ="面额",required = true )
    private Double price;


    @ApiModelProperty(value ="发行数量",required = true )
    private Integer publishNum;


    @ApiModelProperty(value = "已被领取的数量",required = false)
    private Integer receivedNum;

    @ApiModelProperty(value = "已被使用的数量",required = false)
    private Integer UsedNum;

    @ApiModelProperty(value ="所需积分",required = true )
    private Integer points;

    @ApiModelProperty(value ="用户领取后的使用状况1/2 ：使用/未使用" )
    @TableField(exist = false)//这个字段在表中不存在
    private String state;


    @Version
    @ApiModelProperty(value = "乐观锁",required = false)
    private Integer version;

    @ApiModelProperty(value = "我领取的状态1/2 未领取/已领取",required = false)
    @TableField(exist = false)
    private Integer memberstatus=1;


}
